# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfig_ParameterSpec do
  @moduledoc """
  Represents a single parameter to optimize.

  ## Attributes

  *   `categoricalValueSpec` (*type:* `GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_CategoricalValueSpec.t`, *default:* `nil`) - The value spec for a 'CATEGORICAL' parameter.
  *   `childParameterSpecs` (*type:* `list(GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfig_ParameterSpec.t)`, *default:* `nil`) - A child node is active if the parameter's value matches the child node's matching_parent_values. If two items in child_parameter_specs have the same name, they must have disjoint matching_parent_values.
  *   `discreteValueSpec` (*type:* `GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_DiscreteValueSpec.t`, *default:* `nil`) - The value spec for a 'DISCRETE' parameter.
  *   `doubleValueSpec` (*type:* `GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_DoubleValueSpec.t`, *default:* `nil`) - The value spec for a 'DOUBLE' parameter.
  *   `integerValueSpec` (*type:* `GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_IntegerValueSpec.t`, *default:* `nil`) - The value spec for an 'INTEGER' parameter.
  *   `parameter` (*type:* `String.t`, *default:* `nil`) - Required. The parameter name must be unique amongst all ParameterSpecs.
  *   `parentCategoricalValues` (*type:* `GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentCategoricalValueSpec.t`, *default:* `nil`) - 
  *   `parentDiscreteValues` (*type:* `GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentDiscreteValueSpec.t`, *default:* `nil`) - 
  *   `parentIntValues` (*type:* `GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentIntValueSpec.t`, *default:* `nil`) - 
  *   `scaleType` (*type:* `String.t`, *default:* `nil`) - How the parameter should be scaled. Leave unset for categorical parameters.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Required. The type of the parameter.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :categoricalValueSpec =>
            GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_CategoricalValueSpec.t()
            | nil,
          :childParameterSpecs =>
            list(GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfig_ParameterSpec.t())
            | nil,
          :discreteValueSpec =>
            GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_DiscreteValueSpec.t()
            | nil,
          :doubleValueSpec =>
            GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_DoubleValueSpec.t()
            | nil,
          :integerValueSpec =>
            GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_IntegerValueSpec.t()
            | nil,
          :parameter => String.t() | nil,
          :parentCategoricalValues =>
            GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentCategoricalValueSpec.t()
            | nil,
          :parentDiscreteValues =>
            GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentDiscreteValueSpec.t()
            | nil,
          :parentIntValues =>
            GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentIntValueSpec.t()
            | nil,
          :scaleType => String.t() | nil,
          :type => String.t() | nil
        }

  field(:categoricalValueSpec,
    as:
      GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_CategoricalValueSpec
  )

  field(:childParameterSpecs,
    as: GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfig_ParameterSpec,
    type: :list
  )

  field(:discreteValueSpec,
    as:
      GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_DiscreteValueSpec
  )

  field(:doubleValueSpec,
    as:
      GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_DoubleValueSpec
  )

  field(:integerValueSpec,
    as:
      GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_IntegerValueSpec
  )

  field(:parameter)

  field(:parentCategoricalValues,
    as:
      GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentCategoricalValueSpec
  )

  field(:parentDiscreteValues,
    as:
      GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentDiscreteValueSpec
  )

  field(:parentIntValues,
    as:
      GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentIntValueSpec
  )

  field(:scaleType)
  field(:type)
end

defimpl Poison.Decoder,
  for: GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfig_ParameterSpec do
  def decode(value, options) do
    GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfig_ParameterSpec.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.MachineLearning.V1.Model.GoogleCloudMlV1_StudyConfig_ParameterSpec do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
